# Contributor: André Klitzing <aklitzing@gmail.com>
# Contributor: Antoine Fontaine <antoine.fontaine@epfl.ch>
# Maintainer: André Klitzing <aklitzing@gmail.com>
pkgname=py3-h2
_pkgname=h2
pkgver=4.1.0
pkgrel=2
pkgdesc="HTTP/2 State-Machine based protocol implementation"
url="https://github.com/python-hyper/h2"
arch="noarch"
license="MIT"
depends="
	python3
	py3-hyperframe
	py3-hpack
	"
makedepends="py3-setuptools"
checkdepends="py3-pytest py3-hypothesis"
subpackages="$pkgname-pyc"
source="$_pkgname-$pkgver.tar.gz::https://github.com/python-hyper/h2/archive/refs/tags/v$pkgver.tar.gz
	skip-broken-tests.patch
	py311.patch
	"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-h2" # Backwards compatibility
provides="py-h2=$pkgver-r$pkgrel" # Backwards compatibility

build() {
	python3 setup.py build
}

check() {
	PYTHONPATH="$PWD/build/lib" python3 -m pytest -v
}

package() {
	python3 setup.py install --skip-build --root="$pkgdir"
}

sha512sums="
4e9cf88b3ae702a8a42bded775ad337809787fe8172d501c230d55abbf1edd764acf3b227f2e58756d882499661ffcf6bbdd4812a4d938c04fac3f1aa2390b28  h2-4.1.0.tar.gz
a6de0d6342ac3e3b107d5f6863e8b2434d361ac9efbf9eb3fed1e25660ae9d69b8cf5a97cb6d3e94265e4c4aa6d70d2051f050067d7f1ffb59997bfc670e75fb  skip-broken-tests.patch
a91c116b938ffeecc125ad9c55fa6235729235d3f998b030348536648ba8a703e29070cb53869134bec9b6b806144d60598adcfbffb8b283535ddd0e776df00f  py311.patch
"
